import {getRanderText,getsubmitText,getdeleteText} from "../../api/audit/text"

export const state = () => ({
    tableData: []
})

export const mutations = {
    SET_LIST(state, data) {
        state.tableData = data
    },
}


export const actions = {
   async randerText({commit}){
        let r=await getRanderText({pageSize:110,sort:"asc"})
        commit("SET_LIST",r.data)
    
    },
  async  getSubmitText({commit},data){
      data.answers=JSON.stringify( data.answers)
      data.options=JSON.stringify(data.options)
      
    let r=await  getsubmitText(data)
    },
   async  getDeleteText({},data){
      let r=await getdeleteText({id:data})
        console.log(r);
    },
   async getAmendText({},data){

    console.log(data);
 
    }

}